/*
 * @Description:
 * @Author: wlj
 * @Date: 2022-12-27 09:21:46
 * @LastEditors: wlj
 * @LastEditTime: 2023-01-05 14:25:45
 * @FilePath: \my-vite-app\src\store\module\system.ts
 */
import { defineStore } from 'pinia'
import useUser from './user'

// userName.value方式改值需以下代码
const user = useUser()
let { name: userName } = storeToRefs(user)
// userName.value方式改值需以上代码

const system = defineStore('system', {
  state: () => {
    return {
      name: '我是系统相关数据'
    }
  },
  actions: {
    // 修改user文件中的name值
    changeUserName(name: string) {
      // user.name = name
      userName.value = name
    }
  }
})

export default system
